package sk;

public class TestCutString {
	public static void main(String[] args) {
		String src = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		CutString cutString = new CutStringImpl();
		int size = 2;
		int total = src.length();
		int length = total / size;//平均每截长度
		
		if (length == 0) {//不足两截
			cutString.cut(0, total, src);
			return;
		}
		for (int i = 0; i < size ; i ++) {
			int index = i * length;
			if (index > total - 1) {//好像用不到？
				return;
			}
			if (i == size -1) {//最后一截
				int extra = total % size;//最后一截多出来的长度
				cutString.cut(index, length + extra, src);
			} else {
				cutString.cut(index, length, src);
			}
		}
	}
}
